<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="/WEB-INF/tld/c.tld"%>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=path %>/js/bootstrap/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="<%=path %>/js/bootstrap/css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="<%=path %>/js/bootstrap/css/style.css" />
    <script type="text/javascript" src="<%=path %>/js/jquery.1.7.2.js"></script>
    <script type="text/javascript" src="<%=path %>/js/jquery.sorted.js"></script>
    <script type="text/javascript" src="<%=path %>/js/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="<%=path %>/js/bootstrap/js/ckform.js"></script>
    <script type="text/javascript" src="<%=path %>/js/bootstrap/js/common.js"></script>
    
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form class="form-inline definewidth m20" action="<%=path %>/authority/search.do" method="post">
    菜单名称：
    <input type="text" name="menuname" id="menuname"class="abc input-default" placeholder="" value="">&nbsp;&nbsp; 
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; <button type="button" class="btn btn-success" id="addnew">新增菜单</button>
</form>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th>菜单标题</th>
        <th>父节点</th>
        <th>类型</th>
        <th>url</th>
        <th>状态</th>
        <th>管理操作</th>
    </tr>
    </thead>
		<c:forEach items="${authorityList}" var="list">
    	<tr align="center">
			<td>${list.name}</td>
			<td>${list.parentId}</td>
			<td>${list.type}</td>
			<td>${list.url}</td>
			<td>${list.status}</td>
			<td><a href="<%=path %>/authority/updateAsk.do?id=${list.id }">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
			<c:if test="${list.status=='可用'}">
				<a href="<%=path %>/authority/modifyStatus.do?id=${list.id }">禁用</a>
			</c:if>
			<c:if test="${list.status=='禁用'}">
				<a href="<%=path %>/authority/modifyStatus.do?id=${list.id }">启用</a>
			</c:if>
			</td>
		</tr>
		</c:forEach>
	</table>

</body>
</html>
<script>
    $(function () {
        

		$('#addnew').click(function(){

				window.location.href="../authority/toaddMenuPage.do";
		 });


    });
	
</script>